3.3.39 \(\int \frac {\tan (e+f x)}{(a+b \tan ^2(e+f x))^3} \, dx\) [239]

3.3.39.1 Optimal result
3.3.39.2 Mathematica [A] (verified)
3.3.39.3 Rubi [A] (verified)
3.3.39.4 Maple [A] (verified)
3.3.39.5 Fricas [B] (verification not implemented)
3.3.39.6 Sympy [B] (verification not implemented)
3.3.39.7 Maxima [B] (verification not implemented)
3.3.39.8 Giac [B] (verification not implemented)
3.3.39.9 Mupad [B] (verification not implemented)

3.3.39.1 Optimal result

Integrand size = 21, antiderivative size = 93 \[ \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=-\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 (a-b)^3 f}+\frac {1}{4 (a-b) f \left (a+b \tan ^2(e+f x)\right )^2}+\frac {1}{2 (a-b)^2 f \left (a+b \tan ^2(e+f x)\right )} \]

output
-1/2*ln(a*cos(f*x+e)^2+b*sin(f*x+e)^2)/(a-b)^3/f+1/4/(a-b)/f/(a+b*tan(f*x+ 
e)^2)^2+1/2/(a-b)^2/f/(a+b*tan(f*x+e)^2)
 
3.3.39.2 Mathematica [A] (verified)

Time = 0.75 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.88 \[ \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\frac {-4 \log (\cos (e+f x))-2 \log \left (a+b \tan ^2(e+f x)\right )+\frac {(a-b)^2}{\left (a+b \tan ^2(e+f x)\right )^2}+\frac {2 (a-b)}{a+b \tan ^2(e+f x)}}{4 (a-b)^3 f} \]

input
Integrate[Tan[e + f*x]/(a + b*Tan[e + f*x]^2)^3,x]
 
output
(-4*Log[Cos[e + f*x]] - 2*Log[a + b*Tan[e + f*x]^2] + (a - b)^2/(a + b*Tan 
[e + f*x]^2)^2 + (2*(a - b))/(a + b*Tan[e + f*x]^2))/(4*(a - b)^3*f)
 
3.3.39.3 Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.03, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4153, 353, 54, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\tan (e+f x)}{\left (a+b \tan (e+f x)^2\right )^3}dx\)

\(\Big \downarrow \) 4153

\(\displaystyle \frac {\int \frac {\tan (e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )^3}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 353

\(\displaystyle \frac {\int \frac {1}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )^3}d\tan ^2(e+f x)}{2 f}\)

\(\Big \downarrow \) 54

\(\displaystyle \frac {\int \left (\frac {b}{(b-a)^3 \left (b \tan ^2(e+f x)+a\right )}-\frac {b}{(a-b)^2 \left (b \tan ^2(e+f x)+a\right )^2}-\frac {b}{(a-b) \left (b \tan ^2(e+f x)+a\right )^3}+\frac {1}{(a-b)^3 \left (\tan ^2(e+f x)+1\right )}\right )d\tan ^2(e+f x)}{2 f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {1}{(a-b)^2 \left (a+b \tan ^2(e+f x)\right )}+\frac {1}{2 (a-b) \left (a+b \tan ^2(e+f x)\right )^2}+\frac {\log \left (\tan ^2(e+f x)+1\right )}{(a-b)^3}-\frac {\log \left (a+b \tan ^2(e+f x)\right )}{(a-b)^3}}{2 f}\)

input
Int[Tan[e + f*x]/(a + b*Tan[e + f*x]^2)^3,x]
 
output
(Log[1 + Tan[e + f*x]^2]/(a - b)^3 - Log[a + b*Tan[e + f*x]^2]/(a - b)^3 + 
 1/(2*(a - b)*(a + b*Tan[e + f*x]^2)^2) + 1/((a - b)^2*(a + b*Tan[e + f*x] 
^2)))/(2*f)
 

3.3.39.3.1 Defintions of rubi rules used

rule 54
Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[E 
xpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && 
 ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && LtQ[m + n + 2, 0])
 

rule 353
Int[(x_)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_Symbol] 
 :> Simp[1/2   Subst[Int[(a + b*x)^p*(c + d*x)^q, x], x, x^2], x] /; FreeQ[ 
{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
3.3.39.4 Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.16

method result size
derivativedivides \(\frac {\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 \left (a -b \right )^{3}}-\frac {b \left (-\frac {a -b}{b \left (a +b \tan \left (f x +e \right )^{2}\right )}-\frac {a^{2}-2 a b +b^{2}}{2 b \left (a +b \tan \left (f x +e \right )^{2}\right )^{2}}+\frac {\ln \left (a +b \tan \left (f x +e \right )^{2}\right )}{b}\right )}{2 \left (a -b \right )^{3}}}{f}\) \(108\)
default \(\frac {\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 \left (a -b \right )^{3}}-\frac {b \left (-\frac {a -b}{b \left (a +b \tan \left (f x +e \right )^{2}\right )}-\frac {a^{2}-2 a b +b^{2}}{2 b \left (a +b \tan \left (f x +e \right )^{2}\right )^{2}}+\frac {\ln \left (a +b \tan \left (f x +e \right )^{2}\right )}{b}\right )}{2 \left (a -b \right )^{3}}}{f}\) \(108\)
norman \(\frac {\frac {3 a \,b^{2}-b^{3}}{4 b^{2} \left (a^{2}-2 a b +b^{2}\right ) f}+\frac {b \tan \left (f x +e \right )^{2}}{2 \left (a^{2}-2 a b +b^{2}\right ) f}}{\left (a +b \tan \left (f x +e \right )^{2}\right )^{2}}+\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}-\frac {\ln \left (a +b \tan \left (f x +e \right )^{2}\right )}{2 f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}\) \(158\)
parallelrisch \(\frac {2 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right )^{4} b^{4}-2 \ln \left (a +b \tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right )^{4} b^{4}+4 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right )^{2} a \,b^{3}-4 \ln \left (a +b \tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right )^{2} a \,b^{3}+2 \tan \left (f x +e \right )^{2} a \,b^{3}-2 b^{4} \tan \left (f x +e \right )^{2}+2 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{2} b^{2}-2 \ln \left (a +b \tan \left (f x +e \right )^{2}\right ) a^{2} b^{2}+3 a^{2} b^{2}-4 a \,b^{3}+b^{4}}{4 \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \left (a +b \tan \left (f x +e \right )^{2}\right )^{2} b^{2} f}\) \(233\)
risch \(\frac {i x}{a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}}+\frac {2 i e}{f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}-\frac {4 b \left (-a \,{\mathrm e}^{6 i \left (f x +e \right )}+b \,{\mathrm e}^{6 i \left (f x +e \right )}-2 a \,{\mathrm e}^{4 i \left (f x +e \right )}-b \,{\mathrm e}^{4 i \left (f x +e \right )}-a \,{\mathrm e}^{2 i \left (f x +e \right )}+b \,{\mathrm e}^{2 i \left (f x +e \right )}\right )}{\left (-a \,{\mathrm e}^{4 i \left (f x +e \right )}+b \,{\mathrm e}^{4 i \left (f x +e \right )}-2 a \,{\mathrm e}^{2 i \left (f x +e \right )}-2 b \,{\mathrm e}^{2 i \left (f x +e \right )}-a +b \right )^{2} \left (-a +b \right ) \left (a^{2}-2 a b +b^{2}\right ) f}-\frac {\ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a -b}+1\right )}{2 f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}\) \(271\)

input
int(tan(f*x+e)/(a+b*tan(f*x+e)^2)^3,x,method=_RETURNVERBOSE)
 
output
1/f*(1/2/(a-b)^3*ln(1+tan(f*x+e)^2)-1/2*b/(a-b)^3*(-(a-b)/b/(a+b*tan(f*x+e 
)^2)-1/2*(a^2-2*a*b+b^2)/b/(a+b*tan(f*x+e)^2)^2+1/b*ln(a+b*tan(f*x+e)^2)))
 
3.3.39.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 206 vs. \(2 (87) = 174\).

Time = 0.28 (sec) , antiderivative size = 206, normalized size of antiderivative = 2.22 \[ \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=-\frac {3 \, b^{2} \tan \left (f x + e\right )^{4} + 2 \, {\left (2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{2} + 4 \, a b - b^{2} + 2 \, {\left (b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}\right )} \log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right )}{4 \, {\left ({\left (a^{3} b^{2} - 3 \, a^{2} b^{3} + 3 \, a b^{4} - b^{5}\right )} f \tan \left (f x + e\right )^{4} + 2 \, {\left (a^{4} b - 3 \, a^{3} b^{2} + 3 \, a^{2} b^{3} - a b^{4}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{5} - 3 \, a^{4} b + 3 \, a^{3} b^{2} - a^{2} b^{3}\right )} f\right )}} \]

input
integrate(tan(f*x+e)/(a+b*tan(f*x+e)^2)^3,x, algorithm="fricas")
 
output
-1/4*(3*b^2*tan(f*x + e)^4 + 2*(2*a*b + b^2)*tan(f*x + e)^2 + 4*a*b - b^2 
+ 2*(b^2*tan(f*x + e)^4 + 2*a*b*tan(f*x + e)^2 + a^2)*log((b*tan(f*x + e)^ 
2 + a)/(tan(f*x + e)^2 + 1)))/((a^3*b^2 - 3*a^2*b^3 + 3*a*b^4 - b^5)*f*tan 
(f*x + e)^4 + 2*(a^4*b - 3*a^3*b^2 + 3*a^2*b^3 - a*b^4)*f*tan(f*x + e)^2 + 
 (a^5 - 3*a^4*b + 3*a^3*b^2 - a^2*b^3)*f)
 
3.3.39.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2846 vs. \(2 (73) = 146\).

Time = 70.08 (sec) , antiderivative size = 2846, normalized size of antiderivative = 30.60 \[ \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\text {Too large to display} \]

input
integrate(tan(f*x+e)/(a+b*tan(f*x+e)**2)**3,x)
 
output
Piecewise((zoo*x/tan(e)**5, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), (log(tan(e + 
f*x)**2 + 1)/(2*a**3*f), Eq(b, 0)), (-1/(6*b**3*f*tan(e + f*x)**6 + 18*b** 
3*f*tan(e + f*x)**4 + 18*b**3*f*tan(e + f*x)**2 + 6*b**3*f), Eq(a, b)), (x 
*tan(e)/(a + b*tan(e)**2)**3, Eq(f, 0)), (-2*a**2*log(-sqrt(-a/b) + tan(e 
+ f*x))/(4*a**5*f + 8*a**4*b*f*tan(e + f*x)**2 - 12*a**4*b*f + 4*a**3*b**2 
*f*tan(e + f*x)**4 - 24*a**3*b**2*f*tan(e + f*x)**2 + 12*a**3*b**2*f - 12* 
a**2*b**3*f*tan(e + f*x)**4 + 24*a**2*b**3*f*tan(e + f*x)**2 - 4*a**2*b**3 
*f + 12*a*b**4*f*tan(e + f*x)**4 - 8*a*b**4*f*tan(e + f*x)**2 - 4*b**5*f*t 
an(e + f*x)**4) - 2*a**2*log(sqrt(-a/b) + tan(e + f*x))/(4*a**5*f + 8*a**4 
*b*f*tan(e + f*x)**2 - 12*a**4*b*f + 4*a**3*b**2*f*tan(e + f*x)**4 - 24*a* 
*3*b**2*f*tan(e + f*x)**2 + 12*a**3*b**2*f - 12*a**2*b**3*f*tan(e + f*x)** 
4 + 24*a**2*b**3*f*tan(e + f*x)**2 - 4*a**2*b**3*f + 12*a*b**4*f*tan(e + f 
*x)**4 - 8*a*b**4*f*tan(e + f*x)**2 - 4*b**5*f*tan(e + f*x)**4) + 2*a**2*l 
og(tan(e + f*x)**2 + 1)/(4*a**5*f + 8*a**4*b*f*tan(e + f*x)**2 - 12*a**4*b 
*f + 4*a**3*b**2*f*tan(e + f*x)**4 - 24*a**3*b**2*f*tan(e + f*x)**2 + 12*a 
**3*b**2*f - 12*a**2*b**3*f*tan(e + f*x)**4 + 24*a**2*b**3*f*tan(e + f*x)* 
*2 - 4*a**2*b**3*f + 12*a*b**4*f*tan(e + f*x)**4 - 8*a*b**4*f*tan(e + f*x) 
**2 - 4*b**5*f*tan(e + f*x)**4) + 3*a**2/(4*a**5*f + 8*a**4*b*f*tan(e + f* 
x)**2 - 12*a**4*b*f + 4*a**3*b**2*f*tan(e + f*x)**4 - 24*a**3*b**2*f*tan(e 
 + f*x)**2 + 12*a**3*b**2*f - 12*a**2*b**3*f*tan(e + f*x)**4 + 24*a**2*...
 
3.3.39.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 192 vs. \(2 (87) = 174\).

Time = 0.23 (sec) , antiderivative size = 192, normalized size of antiderivative = 2.06 \[ \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\frac {\frac {4 \, {\left (a b - b^{2}\right )} \sin \left (f x + e\right )^{2} - 4 \, a b + b^{2}}{a^{5} - 3 \, a^{4} b + 3 \, a^{3} b^{2} - a^{2} b^{3} + {\left (a^{5} - 5 \, a^{4} b + 10 \, a^{3} b^{2} - 10 \, a^{2} b^{3} + 5 \, a b^{4} - b^{5}\right )} \sin \left (f x + e\right )^{4} - 2 \, {\left (a^{5} - 4 \, a^{4} b + 6 \, a^{3} b^{2} - 4 \, a^{2} b^{3} + a b^{4}\right )} \sin \left (f x + e\right )^{2}} - \frac {2 \, \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}}}{4 \, f} \]

input
integrate(tan(f*x+e)/(a+b*tan(f*x+e)^2)^3,x, algorithm="maxima")
 
output
1/4*((4*(a*b - b^2)*sin(f*x + e)^2 - 4*a*b + b^2)/(a^5 - 3*a^4*b + 3*a^3*b 
^2 - a^2*b^3 + (a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*s 
in(f*x + e)^4 - 2*(a^5 - 4*a^4*b + 6*a^3*b^2 - 4*a^2*b^3 + a*b^4)*sin(f*x 
+ e)^2) - 2*log(-(a - b)*sin(f*x + e)^2 + a)/(a^3 - 3*a^2*b + 3*a*b^2 - b^ 
3))/f
 
3.3.39.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 608 vs. \(2 (87) = 174\).

Time = 0.90 (sec) , antiderivative size = 608, normalized size of antiderivative = 6.54 \[ \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=-\frac {\frac {2 \, \log \left (a + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {4 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} - \frac {4 \, \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} - \frac {3 \, a^{4} + \frac {12 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {8 \, a^{3} b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {24 \, a^{2} b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {8 \, a b^{3} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {18 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {16 \, a^{3} b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {48 \, a^{2} b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {80 \, a b^{3} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {16 \, b^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {12 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {8 \, a^{3} b {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {24 \, a^{2} b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {8 \, a b^{3} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {3 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}}}{{\left (a^{5} - 3 \, a^{4} b + 3 \, a^{3} b^{2} - a^{2} b^{3}\right )} {\left (a + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {4 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}^{2}}}{4 \, f} \]

input
integrate(tan(f*x+e)/(a+b*tan(f*x+e)^2)^3,x, algorithm="giac")
 
output
-1/4*(2*log(a + 2*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 4*b*(cos(f*x + 
 e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2) 
/(a^3 - 3*a^2*b + 3*a*b^2 - b^3) - 4*log(abs(-(cos(f*x + e) - 1)/(cos(f*x 
+ e) + 1) + 1))/(a^3 - 3*a^2*b + 3*a*b^2 - b^3) - (3*a^4 + 12*a^4*(cos(f*x 
 + e) - 1)/(cos(f*x + e) + 1) - 8*a^3*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 
 1) - 24*a^2*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 8*a*b^3*(cos(f*x 
+ e) - 1)/(cos(f*x + e) + 1) + 18*a^4*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 
 1)^2 - 16*a^3*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 48*a^2*b^2*(c 
os(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 80*a*b^3*(cos(f*x + e) - 1)^2/(c 
os(f*x + e) + 1)^2 - 16*b^4*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 12 
*a^4*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3 - 8*a^3*b*(cos(f*x + e) - 1 
)^3/(cos(f*x + e) + 1)^3 - 24*a^2*b^2*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 
 1)^3 + 8*a*b^3*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3 + 3*a^4*(cos(f*x 
 + e) - 1)^4/(cos(f*x + e) + 1)^4)/((a^5 - 3*a^4*b + 3*a^3*b^2 - a^2*b^3)* 
(a + 2*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 4*b*(cos(f*x + e) - 1)/(c 
os(f*x + e) + 1) + a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)^2))/f
 
3.3.39.9 Mupad [B] (verification not implemented)

Time = 11.67 (sec) , antiderivative size = 375, normalized size of antiderivative = 4.03 \[ \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\frac {a^2\,\left (-3+\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,4{}\mathrm {i}\right )+b^2\,\left (2\,{\mathrm {tan}\left (e+f\,x\right )}^2-1+{\mathrm {tan}\left (e+f\,x\right )}^4\,\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,4{}\mathrm {i}\right )+a\,b\,\left (4-2\,{\mathrm {tan}\left (e+f\,x\right )}^2+{\mathrm {tan}\left (e+f\,x\right )}^2\,\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,8{}\mathrm {i}\right )}{f\,\left (-4\,a^5-8\,a^4\,b\,{\mathrm {tan}\left (e+f\,x\right )}^2+12\,a^4\,b-4\,a^3\,b^2\,{\mathrm {tan}\left (e+f\,x\right )}^4+24\,a^3\,b^2\,{\mathrm {tan}\left (e+f\,x\right )}^2-12\,a^3\,b^2+12\,a^2\,b^3\,{\mathrm {tan}\left (e+f\,x\right )}^4-24\,a^2\,b^3\,{\mathrm {tan}\left (e+f\,x\right )}^2+4\,a^2\,b^3-12\,a\,b^4\,{\mathrm {tan}\left (e+f\,x\right )}^4+8\,a\,b^4\,{\mathrm {tan}\left (e+f\,x\right )}^2+4\,b^5\,{\mathrm {tan}\left (e+f\,x\right )}^4\right )} \]

input
int(tan(e + f*x)/(a + b*tan(e + f*x)^2)^3,x)
 
output
(a^2*(atan((a*tan(e + f*x)^2*1i - b*tan(e + f*x)^2*1i)/(2*a + a*tan(e + f* 
x)^2 + b*tan(e + f*x)^2))*4i - 3) + b^2*(tan(e + f*x)^4*atan((a*tan(e + f* 
x)^2*1i - b*tan(e + f*x)^2*1i)/(2*a + a*tan(e + f*x)^2 + b*tan(e + f*x)^2) 
)*4i + 2*tan(e + f*x)^2 - 1) + a*b*(tan(e + f*x)^2*atan((a*tan(e + f*x)^2* 
1i - b*tan(e + f*x)^2*1i)/(2*a + a*tan(e + f*x)^2 + b*tan(e + f*x)^2))*8i 
- 2*tan(e + f*x)^2 + 4))/(f*(12*a^4*b - 4*a^5 + 4*a^2*b^3 - 12*a^3*b^2 + 4 
*b^5*tan(e + f*x)^4 + 8*a*b^4*tan(e + f*x)^2 - 8*a^4*b*tan(e + f*x)^2 - 12 
*a*b^4*tan(e + f*x)^4 - 24*a^2*b^3*tan(e + f*x)^2 + 24*a^3*b^2*tan(e + f*x 
)^2 + 12*a^2*b^3*tan(e + f*x)^4 - 4*a^3*b^2*tan(e + f*x)^4))